
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>秒杀页面</title>
    <meta charset="UTF-8">
    <!-- 引入 Bootstrap -->
    <link
            href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
            rel="stylesheet">
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link
            href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
            rel="stylesheet">
</head>
<body>
<div class="container">
    <div class="panel panel-default">
        <div class="panel-heading text-center">
            <h2>秒杀列表</h2>
        </div>
        <div class="panel-body">
            <table class="table table-hover">
                <thead>
                <tr>
                    <th>名称</th>
                    <th>库存</th>
                    <th>开始时间</th>
                    <th>结束时间</th>
                    <th>创建时间</th>
                    <th>详情页</th>
                </tr>
                </thead>
                <tbody>
<!--                user,iterStat:${page.list}-->
                <tr th:each="sk:${page.list}">
                    <td th:text = "${sk.name}"></td>
                    <td th:text = "${sk.number}"></td>
                    <td th:text="${#dates.format(sk.startTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
                    <td th:text="${#dates.format(sk.endTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
                    <td th:text="${#dates.format(sk.createTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
                    <td>
                        <a class="btn btn-info" th:href="@{${sk.seckillId}+'/detail'}" target="_blank">
                            link
                        </a>
                    </td>
                </tr>
                </tbody>
                <tfoot th:if="${page.pages}>1" th:align="center">
                <tr>
                    <th colspan="7" >
                        <div class="pagination pagination- 1g">
                            <a th:href="@{/seckill/list}" class="item"
                               th:if="${page.hasPreviousPage}">首页</a>
                            <a th:href="@{/seckill/list(pageNum=${page.prePage})}" class="item"
                               th:if="${page.hasPreviousPage}">上一页</a>
                            <a th:href="@{/seckill/list(pageNum=${page.nextPage})}" class="item"
                               th:if="${page.hasNextPage}">下一页</a>
                            <a th:href="@{/seckill/list(pageNum=${page.pages})}" class="item"
                               th:if="${page.hasNextPage}">尾页</a>
                        </div>
                    </th>
                </tr>
                </tfoot>

            </table>
            <div th:align="center">
                <p>当前第<span th:text="${page.pageNum}"></span>页，总<span th:text="${page.pages}">
                            </span>页，共<span th:text="${page.total}"></span>条记录</p>
            </div>
        </div>
    </div>


</div>
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>
